<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app">
        <soncpn>
            <span slot="left">替换左边的</span>
            <button slot="right">替换右边的</button>
        </soncpn>
    </div>
</body>

<template id="soncpn">
    <div>
        <h1>我是子组件</h1>
        <slot name="left"><span>左边</span></slot>
        <slot name="center"><span>中间</span></slot>
        <slot name="right"><span>右边</span></slot>
        <slot><span>没有名字的span</span></slot>
    </div>
</template>
<script src="../js/http_cdn.bootcdn.net_ajax_libs_vue_2.6.6_vue.js"></script>
<script>
    const soncpn={
        template:"#soncpn"
    }
    new Vue({
        el:"#app",
        components:{
            soncpn
        }
    })
</script>
</html>
